package com.bacsumu.boogservice.service;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Service;

import com.bacsumu.boogservice.dao.HelloWorldDao;
import com.bacsumu.boogservice.entity.HelloWorld;
import com.google.appengine.api.datastore.Key;

@Service
public class HelloWorldServiceImpl implements HelloWorldService {
	
	@Autowired
	private HelloWorldDao helloWorldDao;
	
	
	@Autowired
	public HelloWorldServiceImpl(final HelloWorldDao helloWorldDao){
		this.helloWorldDao = helloWorldDao;
	}
	
	//@Required
	public void setHelloWorldDao(final HelloWorldDao helloWorldDao) {
		this.helloWorldDao = helloWorldDao;
	}
	 
	@Override
	public Key create(final HelloWorld helloWorld) {
		return helloWorldDao.create(helloWorld);
	}
	 
	@Override
	public Collection<HelloWorld> getAllGreetings(final int selectedPage) {
		return helloWorldDao.getAllGreetings(selectedPage);
	}
}
